package router

import (
	"jgt-oper/src/context"
	"jgt-oper/src/svc"

	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
)

// SvcEmployeeMap 企业员工管理路由映射
func SvcEmployeeMap(g *inject.Graph, router *gear.Router) {
	employeeSvc := new(svc.Employee)
	err := g.Provide(&inject.Object{Value: employeeSvc})
	if err != nil {
		panic(err)
	}

	router.Get("/employee/query-page", context.WrapContext(employeeSvc.QueryPage))
	router.Get("/employee/:id", context.WrapContext(employeeSvc.QueryDetail))
	router.Put("/employee/:id", context.WrapContext(employeeSvc.CancelAuth))
}
